package com.smart.web.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.smart.web.entity.CartItem;

/**
 *
 */
public interface CartItemMapper extends BaseMapper<CartItem> {

    default IPage<CartItem> selectListByMemberId(Long memberId, Integer page, Integer size) {
        Page<CartItem> iPage = new Page<>(page, size);
        QueryWrapper<CartItem> qw = new QueryWrapper<>();
        qw.lambda().eq(CartItem::getMemberId, memberId);
        return this.selectPage(iPage, qw);
    }
}